<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Areas/MvcWiki.Web.Prototype.MVC2P1.Wiki/Shared/Wiki.Master" Inherits="System.Web.Mvc.ViewPage<WikiPageViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_MvcWikiTitle" runat="server">
	Edit <%= Model.Name %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_MvcWikiMainHeader" runat="server">
    <h2>Edit <%= Html.RouteLink(Model.Name, new { controller = "wikipage", action = "show", @namespace = Model.Namespace, page = Model.Name, revision = "" }) %></h2>
    <p>
        Namespace <strong><%= Model.Namespace %></strong>
        <% if (Model.HasContent){ %>&nbsp;|&nbsp;Revision <strong><%= Model.Revision %></strong><% } %>
        &nbsp;|&nbsp;<%= Html.ActionLink("[Revisions]", "revisions", new { @namespace = Model.Namespace, page = Model.Name }) %>
    </p>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_MvcWikiMainContent" runat="server">
    <% if(Model.HasContent) { %>
        <% using (Html.BeginForm(new { action = "rollback" })) { %>
            <%= Html.Hidden("Namespace") %>
            <%= Html.Hidden("Name") %>
            <fieldset>
                <ul>
                    <li>
                        <%= Html.EditorFor(x => x.Revisions, "RollbackRevisionDropDown", "Revision") %>
                    </li>
                    <li>
                        <input type="submit" value="Rollback" />
                    </li>
                </ul>
            </fieldset>
        <% } %>            
    <% } %>
    <% using (Html.BeginForm()) { %>
        <%= Html.Hidden("Namespace") %>
        <%= Html.Hidden("Name") %>
        <fieldset>
            <ul>
                <li>
                    <%= Html.LabelFor(x => x.Content) %>
                    <%= Html.TextArea("Content") %>
                </li>
                <li>
                    <input type="submit" value="Save" />
                </li>
            </ul>
        </fieldset>
    <% } %>
</asp:Content>